tank=csvread('tank.csv')';
m=csvread('move.csv')';
time = 1:max(tank(1,:));
%time=3000 : max(tank(1,:));

speed = sqrt(tank(5,:).^2 + tank(6,:).^2);
usk = [0 sqrt(diff(tank(5,:)).^2 + diff(tank(6,:)).^2)];
movex = diff(tank(2,time));
movey = diff(tank(3,time));
mov = cumsum([0,sqrt(movex.^2 + movey.^2)]);
adeg = tank(4,time)*180/pi;
asdeg = tank(7,time)*180/pi;


plot(time,adeg);
saveas(gcf,'plot\angle.png');
saveas(gcf,'plot\angle.fig');

plot(time,asdeg);
saveas(gcf,'plot\anglespeed.png');
saveas(gcf,'plot\anglespeed.fig');

plot(time,usk(1,time));
saveas(gcf,'plot\usk.png');
saveas(gcf,'plot\usk.fig');

plot3(time,tank(2,time),tank(3,time));
view(90,0);
ylim([0,1280]);
zlim([0,800]);
saveas(gcf,'plot\map.png');
saveas(gcf,'plot\map.fig');

plot(time, mov);
saveas(gcf,'plot\distance moving.png');
saveas(gcf,'plot\distance moving.fig');

plot(time, m(2,time),time,m(3,time));
ylim([-1.1,1.1]);
saveas(gcf,'plot\move.png');
saveas(gcf,'plot\move.fig');

plot(time, m(5,time));
saveas(gcf,'plot\fire.png');
saveas(gcf,'plot\fire.fig');

plot(time, speed(1,time));
saveas(gcf,'plot\speed.png');
saveas(gcf,'plot\speed.fig');